home *** CD-ROM | disk | FTP | other *** search
/ Aminet 4 / Aminet 4 - November 1994.iso / aminet / dev / obero / oberon_lib.lha / oberon-a / source1.lha / source / Amiga / Printer.mod < prev    next >
Text File  |  1994-08-08  |  20KB  |  440 lines

  1. (**************************************************************************
  2.  
  3.      $RCSfile: Printer.mod $
  4.   Description: Interface to printer.device
  5.  
  6.    Created by: fjc (Frank Copeland)
  7.     $Revision: 3.2 $
  8.       $Author: fjc $
  9.         $Date: 1994/08/08 01:10:41 $
  10.  
  11.   Includes Release 40.15
  12.  
  13.   (C) Copyright 1987-1993 Commodore-Amiga, Inc.
  14.       All Rights Reserved
  15.  
  16.   Oberon-A interface Copyright © 1994, Frank Copeland.
  17.   This file is part of the Oberon-A Interface.
  18.   See Oberon-A.doc for conditions of use and distribution.
  19.  
  20. ***************************************************************************)
  21.  
  22. MODULE Printer;
  23.  
  24. (*
  25. ** $C- CaseChk       $I- IndexChk  $L+ LongAdr   $N- NilChk
  26. ** $P- PortableCode  $R- RangeChk  $S- StackChk  $T- TypeChk
  27. ** $V- OvflChk       $Z- ZeroVars
  28. *)
  29.  
  30. IMPORT
  31.   E := Exec, TI := Timer, P := Parallel, S := Serial, G := Graphics,
  32.   I := Intuition, SYS := SYSTEM;
  33.  
  34.  
  35. (*
  36. **      $VER: printer.h 1.7 (26.7.90)
  37. **
  38. **      printer.device structure definitions
  39. *)
  40.  
  41. CONST
  42.  
  43.   rawWrite *   =   E.cmdNonstd+0;
  44.   prtCommand * =   E.cmdNonstd+1;
  45.   dumpRPort *  =   E.cmdNonstd+2;
  46.   query *      =   E.cmdNonstd+3;
  47.  
  48. (* printer command definitions *)
  49.  
  50.   aRIS *    = 0;   (* ESCc  reset                    ISO *)
  51.   aRIN *    = 1;   (* ESC#1 initialize       +++ *)
  52.   aIND *    = 2;   (* ESCD  lf               ISO *)
  53.   aNEL *    = 3;   (* ESCE  return,lf                ISO *)
  54.   aRI *     = 4;   (* ESCM  reverse lf       ISO *)
  55.  
  56.   aSGR0 *   = 5;   (* ESC[0m normal char set         ISO *)
  57.   aSGR3 *   = 6;   (* ESC[3m italics on              ISO *)
  58.   aSGR23 *  = 7;   (* ESC[23m italics off            ISO *)
  59.   aSGR4 *   = 8;   (* ESC[4m underline on            ISO *)
  60.   aSGR24 *  = 9;   (* ESC[24m underline off          ISO *)
  61.   aSGR1 *   = 10;  (* ESC[1m boldface on             ISO *)
  62.   aSGR22 *  = 11;  (* ESC[22m boldface off           ISO *)
  63.   aSFC *    = 12;  (* SGR30-39  set foreground color ISO *)
  64.   aSBC *    = 13;  (* SGR40-49  set background color ISO *)
  65.  
  66.   aSHORP0 * = 14;  (* ESC[0w normal pitch            DEC *)
  67.   aSHORP2 * = 15;  (* ESC[2w elite on                DEC *)
  68.   aSHORP1 * = 16;  (* ESC[1w elite off       DEC *)
  69.   aSHORP4 * = 17;  (* ESC[4w condensed fine on       DEC *)
  70.   aSHORP3 * = 18;  (* ESC[3w condensed off           DEC *)
  71.   aSHORP6 * = 19;  (* ESC[6w enlarged on             DEC *)
  72.   aSHORP5 * = 20;  (* ESC[5w enlarged off            DEC *)
  73.  
  74.   aDEN6 *   = 21;  (* ESC[6"z shadow print on        DEC (sort of) *)
  75.   aDEN5 *   = 22;  (* ESC[5"z shadow print off       DEC *)
  76.   aDEN4 *   = 23;  (* ESC[4"z doublestrike on        DEC *)
  77.   aDEN3 *   = 24;  (* ESC[3"z doublestrike off       DEC *)
  78.   aDEN2 *   = 25;  (* ESC[2"z  NLQ on                DEC *)
  79.   aDEN1 *   = 26;  (* ESC[1"z  NLQ off       DEC *)
  80.  
  81.   aSUS2 *   = 27;  (* ESC[2v superscript on          +++ *)
  82.   aSUS1 *   = 28;  (* ESC[1v superscript off         +++ *)
  83.   aSUS4 *   = 29;  (* ESC[4v subscript on            +++ *)
  84.   aSUS3 *   = 30;  (* ESC[3v subscript off           +++ *)
  85.   aSUS0 *   = 31;  (* ESC[0v normalize the line      +++ *)
  86.   aPLU *    = 32;  (* ESCL  partial line up          ISO *)
  87.   aPLD *    = 33;  (* ESCK  partial line down        ISO *)
  88.  
  89.   aFNT0 *   = 34;  (* ESC(B US char set        or Typeface  0 (default) *)
  90.   aFNT1 *   = 35;  (* ESC(R French char set    or Typeface  1 *)
  91.   aFNT2 *   = 36;  (* ESC(K German char set    or Typeface  2 *)
  92.   aFNT3 *   = 37;  (* ESC(A UK char set        or Typeface  3 *)
  93.   aFNT4 *   = 38;  (* ESC(E Danish I char set  or Typeface  4 *)
  94.   aFNT5 *   = 39;  (* ESC(H Sweden char set    or Typeface  5 *)
  95.   aFNT6 *   = 40;  (* ESC(Y Italian char set   or Typeface  6 *)
  96.   aFNT7 *   = 41;  (* ESC(Z Spanish char set   or Typeface  7 *)
  97.   aFNT8 *   = 42;  (* ESC(J Japanese char set  or Typeface  8 *)
  98.   aFNT9 *   = 43;  (* ESC(6 Norweign char set  or Typeface  9 *)
  99.   aFNT10 *  = 44;  (* ESC(C Danish II char set or Typeface 10 *)
  100.  
  101. (*
  102.         Suggested typefaces are:
  103.  
  104.          0 - default typeface.
  105.          1 - Line Printer or equiv.
  106.          2 - Pica or equiv.
  107.          3 - Elite or equiv.
  108.          4 - Helvetica or equiv.
  109.          5 - Times Roman or equiv.
  110.          6 - Gothic or equiv.
  111.          7 - Script or equiv.
  112.          8 - Prestige or equiv.
  113.          9 - Caslon or equiv.
  114.         10 - Orator or equiv.
  115. *)
  116.  
  117.   aPROP2 *  = 45;  (* ESC[2p  proportional on        +++ *)
  118.   aPROP1 *  = 46;  (* ESC[1p  proportional off       +++ *)
  119.   aPROP0 *  = 47;  (* ESC[0p  proportional clear     +++ *)
  120.   aTSS *    = 48;  (* ESC[n E set proportional offset ISO *)
  121.   aJFY5 *   = 49;  (* ESC[5 F auto left justify      ISO *)
  122.   aJFY7 *   = 50;  (* ESC[7 F auto right justify     ISO *)
  123.   aJFY6 *   = 51;  (* ESC[6 F auto full justify      ISO *)
  124.   aJFY0 *   = 52;  (* ESC[0 F auto justify off       ISO *)
  125.   aJFY3 *   = 53;  (* ESC[3 F letter space (justify) ISO (special) *)
  126.   aJFY1 *   = 54;  (* ESC[1 F word fill(auto center) ISO (special) *)
  127.  
  128.   aVERP0 *  = 55;  (* ESC[0z  1/8" line spacing      +++ *)
  129.   aVERP1 *  = 56;  (* ESC[1z  1/6" line spacing      +++ *)
  130.   aSLPP *   = 57;  (* ESC[nt  set form length n      DEC *)
  131.   aPERF *   = 58;  (* ESC[nq  perf skip n (n>0)      +++ *)
  132.   aPERF0 *  = 59;  (* ESC[0q  perf skip off          +++ *)
  133.  
  134.   aLMS *    = 60;  (* ESC#9   Left margin set        +++ *)
  135.   aRMS *    = 61;  (* ESC#0   Right margin set       +++ *)
  136.   aTMS *    = 62;  (* ESC#8   Top margin set         +++ *)
  137.   aBMS *    = 63;  (* ESC#2   Bottom marg set        +++ *)
  138.   aSTBM *   = 64;  (* ESC[Pn1;Pn2r  T&B margins      DEC *)
  139.   aSLRM *   = 65;  (* ESC[Pn1;Pn2s  L&R margin       DEC *)
  140.   aCAM *    = 66;  (* ESC#3   Clear margins          +++ *)
  141.  
  142.   aHTS *    = 67;  (* ESCH    Set horiz tab          ISO *)
  143.   aVTS *    = 68;  (* ESCJ    Set vertical tabs      ISO *)
  144.   aTBC0 *   = 69;  (* ESC[0g  Clr horiz tab          ISO *)
  145.   aTBC3 *   = 70;  (* ESC[3g  Clear all h tab        ISO *)
  146.   aTBC1 *   = 71;  (* ESC[1g  Clr vertical tabs      ISO *)
  147.   aTBC4 *   = 72;  (* ESC[4g  Clr all v tabs         ISO *)
  148.   aTBCALL * = 73;  (* ESC#4   Clr all h & v tabs     +++ *)
  149.   aTBSALL * = 74;  (* ESC#5   Set default tabs       +++ *)
  150.   aEXTEND * = 75;  (* ESC[Pn"x extended commands     +++ *)
  151.  
  152.   aRAW *    = 76;      (* ESC[Pn"r     Next 'Pn' chars are raw +++ *)
  153.  
  154. TYPE
  155.  
  156.   IOPrtCmdReqPtr * = CPOINTER TO IOPrtCmdReq;
  157.   IOPrtCmdReq * = RECORD (E.Message)
  158.     device *     : E.DevicePtr; (* device node pointer  *)
  159.     unit *       : E.UnitPtr;   (* unit (driver private)*)
  160.     command *    : E.UWORD;     (* device command *)
  161.     ioFlags *    : E.BSET;
  162.     error *      : SHORTINT;    (* error or warning num *)
  163.     prtCommand * : E.UWORD;     (* printer command *)
  164.     parm0 *      : E.UBYTE;     (* first command parameter *)
  165.     parm1 *      : E.UBYTE;     (* second command parameter *)
  166.     parm2 *      : E.UBYTE;     (* third command parameter *)
  167.     parm3 *      : E.UBYTE;     (* fourth command parameter *)
  168.   END; (* IOPrtCmdReq *)
  169.  
  170.   IODRPReqPtr * = CPOINTER TO IODRPReq;
  171.   IODRPReq * = RECORD (E.Message)
  172.     device *    : E.DevicePtr;   (* device node pointer  *)
  173.     unit *      : E.UnitPtr;     (* unit (driver private)*)
  174.     command *   : E.UWORD;       (* device command *)
  175.     flags *   : E.BSET;
  176.     error *     : SHORTINT;      (* error or warning num *)
  177.     rastPort *  : G.RastPortPtr; (* raster port *)
  178.     colorMap *  : G.ColorMapPtr; (* color map *)
  179.     modes *     : SET;           (* graphics viewport modes *)
  180.     srcX *      : E.UWORD;       (* source x origin *)
  181.     srcY *      : E.UWORD;       (* source y origin *)
  182.     srcWidth *  : E.UWORD;       (* source x width *)
  183.     srcHeight * : E.UWORD;       (* source x height *)
  184.     destCols *  : LONGINT;       (* destination x width *)
  185.     destRows *  : LONGINT;       (* destination y height *)
  186.     special *   : E.WSET;        (* option flags *)
  187.   END; (* IODRPReq *)
  188.  
  189. CONST
  190.  
  191.   specialMilCols *         = 0;  (* DestCols specified in 1/1000" *)
  192.   specialMilRows *         = 1;  (* DestRows specified in 1/1000" *)
  193.   specialFullCols *        = 2;  (* make DestCols maximum possible *)
  194.   specialFullRows *        = 3;  (* make DestRows maximum possible *)
  195.   specialFracCols *        = 4;  (* DestCols is fraction of FULLCOLS *)
  196.   specialFracRows *        = 5;  (* DestRows is fraction of FULLROWS *)
  197.   specialCenter *          = 6;  (* center image on paper *)
  198.   specialAspect *          = 7;  (* ensure correct aspect ratio *)
  199.   specialDensity1 *        = {8};  (* lowest resolution (dpi) *)
  200.   specialDensity2 *        = {9};  (* next res *)
  201.   specialDensity3 *        = {8,9};  (* next res *)
  202.   specialDensity4 *        = {10};  (* next res *)
  203.   specialDensity5 *        = {8,10};  (* next res *)
  204.   specialDensity6 *        = {9,10};  (* next res *)
  205.   specialDensity7 *        = {8,9,10};  (* highest res *)
  206.   specialNoFormFeed *      = 11;  (* don't eject paper on gfx prints *)
  207.   specialTrustMe *         = 12;  (* don't reset on gfx prints *)
  208. (*
  209.         Compute print size, set 'ioDestCols' and 'ioDestRows' in the calling
  210.         program's 'IODRPReq' structure and exit, DON'T PRINE.  This allows the
  211.         calling program to see what the final print size would be in printer
  212.         pixels.  Note that it modifies the 'ioDestCols' and 'ioDestRows'
  213.         fields of your 'IODRPReq' structure.  Also, set the print density and
  214.         update the 'MaxXDots', 'MaxYDots', 'XDotsInch', and 'YDotsInch' fields
  215.         of the 'PrinterExtendedData' structure.
  216. *)
  217.   specialNoPrint *         = 13;  (* see above *)
  218.  
  219.   errNoErr *             = 0;       (* clean exit, no errors *)
  220.   errCancel *            = 1;       (* user cancelled print *)
  221.   errNotGraphics *       = 2;       (* printer cannot output graphics *)
  222.   errInvertHam *         = 3;       (* OBSOLETE *)
  223.   errBadDimension *      = 4;       (* print dimensions illegal *)
  224.   errDimensionOvflow *   = 5;       (* OBSOLETE *)
  225.   errInternalMemory *    = 6;       (* no memory for internal variables *)
  226.   errBufferMemory *      = 7;       (* no memory for print buffer *)
  227. (*
  228.         Note * : this is an internal error that can be returned from the render
  229.         function to the printer device.  It is NEVER returned to the user.
  230.         If the printer device sees this error it converts it 'PderrNOERR'
  231.         and exits gracefully.  Refer to the document on
  232.         'How to Write a Graphics Printer Driver' for more info.
  233. *)
  234.   errTookControl *       = 8;       (* Took control in case 0 of render *)
  235.  
  236. (* internal use *)
  237.   specialDensityMask *     = {8..10};  (* masks out density values *)
  238.   specialDimensionsMask *  =
  239.     { specialMilCols .. specialFracRows, specialAspect };
  240.  
  241. (*
  242. **      $VER: prtgfx.h 1.12 (26.7.90)
  243. **
  244. **      printer.device structure definitions
  245. *)
  246.  
  247. CONST
  248.  
  249.   pcmYellow *       = 0;               (* byte index for yellow *)
  250.   pcmMagenta *      = 1;               (* byte index for magenta *)
  251.   pcmCyan *         = 2;               (* byte index for cyan *)
  252.   pcmBlack *        = 3;               (* byte index for black *)
  253.   pcmBlue *         = pcmYellow;       (* byte index for blue *)
  254.   pcmGreen *        = pcmMagenta;      (* byte index for green *)
  255.   pcmRed *          = pcmCyan;         (* byte index for red *)
  256.   pcmWhite *        = pcmBlack;        (* byte index for white *)
  257.  
  258. TYPE
  259.  
  260.   colorEntryPtr * = CPOINTER TO colorEntry;
  261.   colorEntry * = RECORD
  262.   (*colorLong *  : E.ULONG;            (* quick access to all of YMCB *)*)
  263.     colorByte *  : ARRAY 4 OF E.UBYTE; (* 1 entry for each of YMCB *)
  264.   (*colorSByte * : SHORTINT[4];        (* ditto (except signed) *)*)
  265.   END; (* colorEntry *)
  266.  
  267.   PrtInfoPtr * = CPOINTER TO PrtInfo;
  268.   PrtInfo * = RECORD
  269.     render        : PROCEDURE (): LONGINT; (* PRIVATE - DO NOT USE! *)
  270.     rp            : G.RastPortPtr; (* PRIVATE - DO NOT USE! *)
  271.     temprp        : G.RastPortPtr; (* PRIVATE - DO NOT USE! *)
  272.     rowBuf        : E.APTR;        (* PRIVATE - DO NOT USE! *)
  273.     hamBuf        : E.APTR;        (* PRIVATE - DO NOT USE! *)
  274.     colorMap      : colorEntryPtr; (* PRIVATE - DO NOT USE! *)
  275.     colorInt *    : colorEntryPtr; (* color intensities for entire row *)
  276.     hamInt        : colorEntryPtr; (* PRIVATE - DO NOT USE! *)
  277.     dest1Int      : colorEntryPtr; (* PRIVATE - DO NOT USE! *)
  278.     dest2Int      : colorEntryPtr; (* PRIVATE - DO NOT USE! *)
  279.     scaleX *      : E.APTR;        (* array of scale values for X *)
  280.     scaleXAlt     : E.APTR;        (* PRIVATE - DO NOT USE! *)
  281.     dmatrix *     : E.APTR;        (* pointer to dither matrix *)
  282.     topBuf        : E.APTR;        (* PRIVATE - DO NOT USE! *)
  283.     botBuf        : E.APTR;        (* PRIVATE - DO NOT USE! *)
  284.  
  285.     rowBufSize    : E.UWORD;       (* PRIVATE - DO NOT USE! *)
  286.     hamBufSize    : E.UWORD;       (* PRIVATE - DO NOT USE! *)
  287.     colorMapSize  : E.UWORD;       (* PRIVATE - DO NOT USE! *)
  288.     colorIntSize  : E.UWORD;       (* PRIVATE - DO NOT USE! *)
  289.     hamIntSize    : E.UWORD;       (* PRIVATE - DO NOT USE! *)
  290.     dest1IntSize  : E.UWORD;       (* PRIVATE - DO NOT USE! *)
  291.     dest2IntSize  : E.UWORD;       (* PRIVATE - DO NOT USE! *)
  292.     scaleXSize    : E.UWORD;       (* PRIVATE - DO NOT USE! *)
  293.     scaleXAltSize : E.UWORD;       (* PRIVATE - DO NOT USE! *)
  294.  
  295.     prefsFlags    : E.WSET;        (* PRIVATE - DO NOT USE! *)
  296.     special       : E.ULONG;       (* PRIVATE - DO NOT USE! *)
  297.     xstart        : E.UWORD;       (* PRIVATE - DO NOT USE! *)
  298.     ystart        : E.UWORD;       (* PRIVATE - DO NOT USE! *)
  299.     width *       : E.UWORD;       (* source width (in pixels) *)
  300.     height        : E.UWORD;       (* PRIVATE - DO NOT USE! *)
  301.     pc            : E.ULONG;       (* PRIVATE - DO NOT USE! *)
  302.     pr            : E.ULONG;       (* PRIVATE - DO NOT USE! *)
  303.     ymult         : E.UWORD;       (* PRIVATE - DO NOT USE! *)
  304.     ymod          : E.UWORD;       (* PRIVATE - DO NOT USE! *)
  305.     ety           : INTEGER;       (* PRIVATE - DO NOT USE! *)
  306.     xpos *        : E.UWORD;       (* offset to start printing picture *)
  307.     threshold *   : E.UWORD;       (* threshold value (from prefs) *)
  308.     tempwidth     : E.UWORD;       (* PRIVATE - DO NOT USE! *)
  309.     flags         : E.WSET;        (* PRIVATE - DO NOT USE! *)
  310.   END; (* PrtInfo *)
  311.  
  312. (*
  313. **      $VER: prtbase.h 1.10 (2.11.90)
  314. **
  315. **      printer.device base structure definitions
  316. *)
  317.  
  318. TYPE
  319.  
  320.   DeviceDataPtr * = CPOINTER TO DeviceData;
  321.   DeviceData * = RECORD (E.Library) (* standard library node *)
  322.     segment *     : SYS.BPTR;       (* A0 when initialized *)
  323.     execBase *    : E.LibraryPtr;   (* A6 for exec *)
  324.     cmdVectors *  : E.APTR;         (* command table for device commands *)
  325.     cmdBytes *    : E.APTR;         (* bytes describing which command queue *)
  326.     numCommands * : E.UWORD;        (* the number of commands supported *)
  327.   END; (* DeviceData *)
  328.  
  329. CONST
  330.  
  331.   oldStkSize *    = 0800H;  (* stack size for child task (OBSOLETE) *)
  332.   stkSize *       = 1000H;  (* stack size for child task *)
  333.   bufSize *       = 256;    (* size of internal buffers for text i/o *)
  334.   safeSize *      = 128;    (* safety margin for text output buffer *)
  335.  
  336. TYPE
  337.  
  338.   PrinterExtendedDataPtr * = CPOINTER TO PrinterExtendedData;
  339.   PrinterExtendedData * = RECORD
  340.     printerName *  : E.STRPTR;  (* printer name, null terminated *)
  341.     init *         : PROCEDURE; (* called after LoadSeg *)
  342.     expunge *      : PROCEDURE; (* called before UnLoadSeg *)
  343.     open *         : PROCEDURE () : LONGINT; (* called at OpenDevice *)
  344.     close *        : PROCEDURE; (* called at CloseDevice *)
  345.     printerClass * : E.BSET;    (* printer class *)
  346.     colorClass *   : E.BSET;    (* color class *)
  347.     maxColumns *   : E.UBYTE;   (* number of print columns available *)
  348.     numCharSets *  : E.UBYTE;   (* number of character sets *)
  349.     numRows *      : E.UWORD;   (* number of 'pins' in print head *)
  350.     maxXDots *     : E.ULONG;   (* number of dots max in a raster dump *)
  351.     maxYDots *     : E.ULONG;   (* number of dots max in a raster dump *)
  352.     xDotsInch *    : E.UWORD;   (* horizontal dot density *)
  353.     yDotsInch *    : E.UWORD;   (* vertical dot density *)
  354.     commands *     : E.APTR;    (* printer text command table *)
  355.     doSpecial *    : PROCEDURE () : LONGINT; (* Special command handler *)
  356.     render *       : PROCEDURE () : LONGINT; (* raster render function *)
  357.     timeoutSecs *  : LONGINT;   (* good write timeout *)
  358.     (* the following only exists if the segment version is >= 33 *)
  359.     eight8BitChars * : E.APTR;    (* conv. strings for the extended font *)
  360.     printMode *    : LONGINT;   (* set if text printed, otherwise 0 *)
  361.     (* the following only exists if the segment version is >= 34 *)
  362.     (* ptr to conversion function for all chars *)
  363.     convFunc *     : PROCEDURE () : LONGINT;
  364.   END; (* PrinterExtendedData *)
  365.  
  366.   PrinterSegmentPtr * = CPOINTER TO PrinterSegment;
  367.   PrinterSegment * = RECORD
  368.     nextSegment * : SYS.BPTR; (* (actually a BPTR) *)
  369.     runAlert *    : E.ULONG;  (* MOVEQ #0,D0 * : RTS *)
  370.     version *     : E.UWORD;  (* segment version *)
  371.     revision *    : E.UWORD;  (* segment revision *)
  372.     ped *         : PrinterExtendedData;   (* printer extended data *)
  373.   END; (* PrinterSegment *)
  374.  
  375.   PrinterDataPtr * = CPOINTER TO PrinterData;
  376.   PrinterData * = RECORD (DeviceData)
  377.     unit *         : E.MsgPort;   (* the one and only unit *)
  378.     printerSegment * : SYS.BPTR;  (* the printer specific segment *)
  379.     printerType *  : E.UWORD;     (* the segment printer type *)
  380.                                   (* the segment data structure *)
  381.     segmentData *  : PrinterSegmentPtr;
  382.     printBuf *     : E.APTR;    (* the raster print buffer *)
  383.     pWrite *       : PROCEDURE () : LONGINT; (* the write function *)
  384.     pBothReady *   : PROCEDURE () : LONGINT; (* write function's done *)
  385.     p0 *           : P.IOExtPar; (* port I/O request 0 *)
  386.     p0pad          : ARRAY (SIZE (S.IOExtSer) - SIZE (P.IOExtPar)) OF SYS.BYTE;
  387.     p1 *           : P.IOExtPar; (*   and 1 for double buffering *)
  388.     p1pad          : ARRAY (SIZE (S.IOExtSer) - SIZE (P.IOExtPar)) OF SYS.BYTE;
  389.     tior *         : TI.TimeRequest; (* timer I/O request *)
  390.     iorPort *      : E.MsgPort;      (* and message reply port *)
  391.     tc *           : E.Task;         (* write task *)
  392.     oldStk *       : ARRAY oldStkSize OF SYS.BYTE;
  393.                                      (* and stack space (OBSOLETE) *)
  394.     pdFlags *      : E.BSET;         (* device flags *)
  395.     pdPad *        : E.UBYTE;        (* padding *)
  396.     preferences *  : I.Preferences;  (* the latest preferences *)
  397.     pWaitEnabled * : E.UBYTE;        (* wait function switch *)
  398.     (* new fields for V2.0 *)
  399.     flags1 *       : E.BSET;         (* padding *)
  400.     stk *          : ARRAY stkSize OF SYS.BYTE;
  401.                                      (* stack space *)
  402.   END; (* PrinterData *)
  403.  
  404. CONST
  405.  
  406. (* Printer Class *)
  407.   pcGfx *         = 0;      (* graphics (bit position) *)
  408.   pcColor *       = 1;      (* color (bit position) *)
  409.  
  410.   pcBwAlpha *     = {};               (* black&white alphanumerics *)
  411.   pcBwGfx *       = {pcGfx};          (* black&white graphics *)
  412.   pcColorAlpha *  = {pcColor};        (* color alphanumerics *)
  413.   pcColorGfx *    = {pcGfx, pcColor}; (* color graphics *)
  414.  
  415. (* Color Class *)
  416.   ccBw *          = {0};       (* black&white only *)
  417.   ccYmc *         = {1};       (* yellow/magenta/cyan only *)
  418.   ccYmcBW *       = {0, 1};    (* yellow/magenta/cyan or black&white *)
  419.   ccYmcb *        = 2;         (* yellow/magenta/cyan/black *)
  420.   ccFourcolor *   = 2;         (* a flag for YMCB and BGRW *)
  421.   ccAdditive *    = 3;         (* not ymcb but blue/green/red/white *)
  422.   ccWb *          = {0, 3};    (* black&white only, 0 * == BLACK *)
  423.   ccBgr *         = {1, 3};    (* blue/green/red *)
  424.   ccBgrWB *       = {0, 1, 3}; (* blue/green/red or black&white *)
  425.   ccBgrw *        = {2, 3};    (* blue/green/red/white *)
  426. (*
  427.         The picture must be scanned once for each color component, as the
  428.         printer can only define one color at a time.  ie. If 'PccYMC' then
  429.         first pass sends all 'Y' info to printer, second pass sends all 'M'
  430.         info, and third pass sends all C info to printer.  The CalComp
  431.         PlotMaster is an example of this type of printer.
  432. *)
  433.   ccMultiPass *  = 4;    (* see explanation above *)
  434.  
  435. CONST
  436.  
  437.   name * = "printer.device";
  438.  
  439. END Printer.
  440.